﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:local="clr-namespace:EIA.SLClient.PlatManage.PMMgr"
	xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
	mc:Ignorable="d"
	x:Class="EIA.SLClient.PlatManage.PMMgr.DicTypeListView"
	d:DesignWidth="210" d:DesignHeight="480">
	<UserControl.Resources>
		<local:DicTypeListViewModel x:Key="DicTypeListViewModelDataSource" />
		<DataTemplate x:Key="DicTypeDataTemplate">
			<Grid d:DesignWidth="160">
				<TextBlock HorizontalAlignment="Left" Margin="8,4,0,4" TextWrapping="Wrap" Text="{Binding DicName}" d:LayoutOverrides="Height" Foreground="#FF806C97"/>
			</Grid>
		</DataTemplate>
		<Style x:Key="ListBoxItemStyle1" TargetType="ListBoxItem">
			<Setter Property="Padding" Value="3"/>
			<Setter Property="HorizontalContentAlignment" Value="Left"/>
			<Setter Property="VerticalContentAlignment" Value="Top"/>
			<Setter Property="Background" Value="Transparent"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="TabNavigation" Value="Local"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="ListBoxItem">
						<Grid Background="{TemplateBinding Background}">
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver">
										<Storyboard>
											<DoubleAnimation Duration="0" To=".35" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="fillColor"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Disabled">
										<Storyboard>
											<DoubleAnimation Duration="0" To=".55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="contentPresenter"/>
										</Storyboard>
									</VisualState>
								</VisualStateGroup>
								<VisualStateGroup x:Name="SelectionStates">
									<VisualState x:Name="Unselected"/>
									<VisualState x:Name="Selected">
										<Storyboard>
											<DoubleAnimation Duration="0" To=".75" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="fillColor2"/>
										</Storyboard>
									</VisualState>
								</VisualStateGroup>
								<VisualStateGroup x:Name="FocusStates">
									<VisualState x:Name="Focused"/>
									<VisualState x:Name="Unfocused"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Rectangle x:Name="fillColor" Fill="#FFBADDE9" IsHitTestVisible="False" Opacity="0" RadiusY="1" RadiusX="1"/>
							<Rectangle x:Name="fillColor2" Fill="#FFBADDE9" IsHitTestVisible="False" Opacity="0" RadiusY="1" RadiusX="1"/>
							<ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</UserControl.Resources>
	<UserControl.FontSize>
		<StaticResource ResourceKey="FontSize"/>
	</UserControl.FontSize>
	<UserControl.FontFamily>
		<StaticResource ResourceKey="FontFamily"/>
	</UserControl.FontFamily>

	<Grid x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource DicTypeListViewModelDataSource}}">
		<i:Interaction.Triggers>
			<i:EventTrigger>
				<ei:CallMethodAction TargetObject="{Binding Mode=OneWay}" MethodName="OnLoad"/>
			</i:EventTrigger>
		</i:Interaction.Triggers>
		<Path Data="M210,0 L210,480.02963" HorizontalAlignment="Right" Margin="0" Stretch="Fill" Stroke="#FFE1E1E1" UseLayoutRounding="False" Width="1" d:IsLocked="True"/>
		<ListBox Margin="8" BorderThickness="0" Background="{x:Null}" ItemTemplate="{StaticResource DicTypeDataTemplate}" ItemContainerStyle="{StaticResource ListBoxItemStyle1}" ItemsSource="{Binding DicTypeCollection}" SelectedItem="{Binding SelectedDicType, Mode=TwoWay}" HorizontalContentAlignment="Stretch"/>
	</Grid>
</UserControl>
